#pragma once

#include <QFrame>
#include <qlinkedlist.h>
#include <qlist.h>
#include <qsize.h>
#include <qlabel.h>
#include <qtimer.h>

class Frame_TurnTableStateShower : public QFrame
{
	Q_OBJECT

public:
	enum LineColor
	{
		Write = 0,
		Red = 1,
		Green = 2
	};

private:
	QLinkedList<QList<int>*> imageMatrix;
	QSize mySize = QSize(700, 360);
	int topSpace = 50;
	int bottomSpace = 10;
	int imageWidth = 700;
	int imageHeight = 300;



	QLabel* label_topMark=Q_NULLPTR;
	QLabel* label_midMark = Q_NULLPTR;
	QLabel* label_botMark = Q_NULLPTR;
	QLabel* label_redLinePosition = Q_NULLPTR;
	QLabel* label_greenLineRate = Q_NULLPTR;
public:
	Frame_TurnTableStateShower(QWidget* parent);
	~Frame_TurnTableStateShower();
public:
	void paintNewState(int position, int rate, int targetRate);
protected:
	void paintEvent(QPaintEvent* event) override;
private:
	void paintImage();
	int getMidPos();
	int getTopPos();
	int getBotPos();
};
